package ar.edu.utn.frba.disenio.aterrizar.ui.arena;

import org.uqbar.arena.actions.MessageSend;
import org.uqbar.arena.layout.HorizontalLayout;
import org.uqbar.arena.layout.VerticalLayout;
import org.uqbar.arena.widgets.Button;
import org.uqbar.arena.widgets.Label;
import org.uqbar.arena.widgets.Panel;
import org.uqbar.arena.windows.WindowOwner;
import org.uqbar.commons.model.UserException;

public class MessageWindow extends AterrizarWindow<UserException>{
	
	public MessageWindow(WindowOwner owner, UserException model) {
		super(owner, model);
	}
	
	@Override
	public void createContents(Panel mainPanel){
		super.createContents(mainPanel);
		mainPanel.setLayout(new VerticalLayout());
		new Label(mainPanel).setText(this.getModelObject().getMessage());
		Panel aPanel = new Panel(mainPanel);
		aPanel.setLayout(new HorizontalLayout());
		new Button(aPanel)//
		.setCaption("Aceptar")
		.onClick(new MessageSend(this, "close")); 
	}
}
